<button class="btn btn-success btn-sm" data-toggle="modal" data-target="#taskCreate">新增任务</button>

<div class="modal fade" id="taskCreate" tabindex="-1" role="dialog" aria-labelledby="taskCreate"
     aria-hidden="true">
    <div class="modal-dialog modal-xs">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true" style="font-size: 36px;">&times;</button>
                <h4 class="modal-title" id="myModalLabel">新增任务</h4>
            </div>
            <div class="modal-body">
                <div class="mb-3">
                    <label for="exampleFormControlInput1" class="form-label">任务名</label>
                    <input type="text" name="taskName" class="form-control" placeholder="请输入任务名">
                </div>
                <div class="mb-3">
                    <label for="exampleFormControlInput1" class="form-label">备注</label>
                    <textarea name="remark" class="form-control" placeholder="请输入备注">
                    </textarea>
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                <button type="button" class="btn btn-primary" onclick="customerCreate()">提交</button>
            </div>
        </div>
    </div>
</div>
<script>
    function customerCreate()
    {
        ajaxPostFunc('/admin/ajax/taskCreate', {
            task_name: $("input[name='taskName']").val(),
            remark: $("textarea[name='remark']").val(),
            _token: $.admin.token
        }, {}, res => {
            console.log(res);
            window.location.reload();
        });
    }
</script>
